package com.wecon.springdemo.pattern;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author Weikang  Wang
 * @program: com.wecon.springdemo.pattern
 * @description:
 * @date 2020/4/15 11:49
 */
public class Test {

    public static void main(String[] args) {
        int i = maxOfThreeNumbers(1, 9, 0);
        System.out.println(i);
    }

    public static int maxOfThreeNumbers(int num1, int num2, int num3) {
        // write your code here

        int bigger = num1;

        List<Integer> list = new ArrayList<>();
        list.add(num1);
        list.add(num2);
        list.add(num3);

        for (int i = 0; i < list.size(); i++) {
            if (list.get(i) > bigger) {
                bigger = list.get(i);
            }
        }

        return bigger;
    }
}
